<template>
    <a-result
        status="success"
        title="这是首页正在开发中..."
        sub-title="恭喜您登录成功，现在您可以尝试登出。"
    >
        <template #extra>
            <a-button key="buy" @click="logout">
               登出
            </a-button>
        </template>
    </a-result>
</template>

<script>
import {logout} from "@/api/login";

export default {
    name: "Index",
    data() {
        return {
        }
    },
    methods:{
        logout(){
           logout().then((res) => {
               if (res.data.success){
                   this.$store.commit('RESET_STATE')
                   this.$router.push('/')
               }else {
                   this.$message.error(res.data.msg)
               }
           })
        }
    }
}
</script>

<style lang="less" scoped>

</style>
